<template>
	<view class="home-sort">
		<HM-dragSorts :list="list" @confirm="confirm">
			<template slot="rowContent" slot-scope="{ row }">
				<view class="row">
					<text class="text">{{row.type_name}}</text>
				</view>
			</template>
		</HM-dragSorts>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(){
				this.$api.GetIndexSort({
					is_store: 1,
					store_id: JSON.parse(uni.getStorageSync('userInfo')).store_id
				}).then(res => {
					this.list = res.datas
				})
			},
			confirm(e){
				this.$api.UpIndexSort({
					store_id: JSON.parse(uni.getStorageSync('userInfo')).store_id,
					index_sort: JSON.stringify(e.list)
				})
			}
		}
	}
</script>

<style lang="scss">
	.home-sort{
		.tips{
			
		}
	}
</style>
